****PSRM replication code*****
****Bethany Shockley and Justin Gengler*****
****Prepared December 2022****



cd "/Users/bethanyshockley/Documents/Spring 2020/Research/naturalization"

log using "/Users/bethanyshockley/Documents/Spring 2020/Research/naturalization/PSRM replication.log" , replace

use "/Users/bethanyshockley/Documents/Spring 2020/Research/naturalization/PSRM replication Figures4&5 data.dta"

*Figure 4: Factors determining Acceptance of Immigrants (Standardized)

graph box factor_tribe factor_arab factor_lang factor_muslim factor_econ factor_resid factor_secur, scheme(s1mono) noout ytitle("Standard Deviations") box(1, fcolor(gray) lcolor(black)) box(2, fcolor(gray) lcolor(black)) box(3, fcolor(gray) lcolor(black)) box(4, fcolor(gray) lcolor(black)) box(5, fcolor(gray) lcolor(black)) box(6, fcolor(gray) lcolor(black)) box(7, fcolor(gray) lcolor(black)) medline(lcolor(black)) showyvars yvaroptions(label(angle(rvertical))) note("") legend(off)
graph export figure4.pdf , replace

**Note that the direction of the yaxis title was reversed using photoshop editing software in order to be consistent with the xaxis labels. 

* Figure 5: Plot of overall support by social desirability (BIDR)

svy: ologit overall_q i.gender c.respage##c.respage educall scale
margins, at(scale=(-3(1)3))
marginsplot, scheme(s1color) plot2opts(lstyle(none) msymbol(none)) ci2opts(lstyle(none))plot1opts(lcolor(gray) mcolor(gray)) ci1opt(lcolor(gray)) plot3opts(lcolor(black) mcolor(black)) ci3opt(lcolor(black)) ylabel(0(.2).8) xtitle("BIDR Impression Management Scale (Social Desirability)") ytitle(Predicted Probability) title("") legend(order(1 "Low Support" 3 "High Support"))
graph export figure5.pdf , replace

*Appendix Table A.1

*income
svy: tab income2 
*gender
svy: tab gender 
*age 
sum respage
*education
svy: tab educ3
*evalfactorsa
svy: tab evalfactorsa 
svy: tab evalfactorsb 
svy: tab evalfactorsc 
svy: tab evalfactorsd 
svy: tab evalfactorse 
svy: tab evalfactorsf 
svy: tab evalfactorsg

log close

